package com.lzx.adx.report.support.strategy.mpping;

import com.alibaba.fastjson.JSONObject;
import com.lzx.adx.report.model.common.CommonReportRequest;
import com.lzx.adx.report.model.proxy.ProxyReq;
import com.lzx.adx.report.model.sfkj.SfkjRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 西安小鱼
 */
@Component
@Slf4j
public class XaxyReportMappingStrategy extends AbstractReportParamsMapping{
    @Override
    public CommonReportRequest adapter(Map<String, Object> params) {
        String jsonString = JSONObject.toJSONString(params);
        log.info("西安小鱼的原始参数为{}",jsonString);
        ProxyReq proxyReq = JSONObject.parseObject(jsonString, ProxyReq.class);
        CommonReportRequest commonReportRequest=new CommonReportRequest();
        BeanUtils.copyProperties(proxyReq,commonReportRequest);
        return commonReportRequest;
    }
}
